<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div>
      <h1>Webpack-DefinePlugin</h1>
      <p>这是一个插件,为代码注入全局成员(process.env.NODE_ENV)</p>
      <p>const webpack = require('webpack')</p>
      <p>
        plugin:{new webpack.DefinePlugin({ API_BASE_URL
        :'"https://www.baidu.com"'})}
      </p>
      <p>
        然后再其他文件console.log(API_BASE_URL)就会打印出"https://www.baidu.com"
      </p>
    </div>
    <script></script>
  </body>
</html>
